package com.xiaoming.annotation;

import java.lang.reflect.Method;

public class AnnoMainTest {

    public static void main(String[] args) throws Exception{
        getAnnoByReflex();
    }
    private static void getAnnoByReflex() throws Exception {
        Class<?> aClass = Class.forName("com.xiaoming.annotation.User");
        Method say = aClass.getDeclaredMethod("say");
        DemoAnno declaredAnnotation = say.getDeclaredAnnotation(DemoAnno.class);
        System.out.println(declaredAnnotation.value());
    }
}
class User {
    @DemoAnno("XiaoMing")
    public String say(){
        System.out.println("say some thing");
        return null;
    }
}
